import request from '@/utils/request'

export function getRewards(data, offset, limit) {
  return request({
    url: '/reward',
    method: 'get',
    params: {
      userId: data.userId,
      type: data.type,
      status: data.status,
      offset: offset,
      limit: limit
    }
  })
}

export function getMyReward() {
  return request({
    url: '/reward/mine',
    method: 'get'
  })
}

export function batchAddReward(data) {
  return request({
    url: '/reward',
    method: 'post',
    data
  })
}

export function modifyReward(id, data) {
  return request({
    url: `/reward/${id}`,
    method: 'put',
    data
  })
}


export function deleteReward(id, status) {
  return request({
    url: `/reward/status/${id}?status=${status}`,
    method: 'put'
  })
}
